﻿using AccessibilityTools.DB;
using AccessibilityTools.DB.Serivce;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TianYi.Bll
{
    public class ErrorInfoLogic
    {
        ErrorInfoDal errorInfoDal =new ErrorInfoDal();

        public List<ErrorInfo> AllList()
        {
            return errorInfoDal.Query();
        }

        public void Add(ErrorInfo log)
        {
            errorInfoDal.Add(log);
        }

        public List<ErrorInfo> SelectDetailsByDatetime(DateTime dtStart, DateTime dtEnd)
        {
            return errorInfoDal.QueryYieldInfoByDate(dtStart, dtEnd);
        }
        public void UpDate(ErrorInfo Instance/*,string sn*/)
        {

            errorInfoDal.Update(Instance);

        }

        /// <summary>
        /// 通过二维码查询单个数据
        /// </summary>
        /// <param name="sn">二维码</param>
        /// <returns></returns>
        public ErrorInfo GetInstance(string sn)
        {
            return errorInfoDal.QuerySingle(sn);
        }
        /// <summary>
        /// 通过sn删除数据表
        /// </summary>
        /// <param name="sn">装箱码</param>
        public bool Delete(int sn)
        {
            bool p = errorInfoDal.Delete(sn);
            return p;
        }
    }
}
